#include<iostream>
#include"stock20.h"

const int STKS=4;
int main()
{
    using std::cout;
    using std::endl;
    Stock stocks[STKS]={
            Stock("yelan company",23,45),
            Stock("ganyu company",12,67),
            Stock("shenli company",45,78),
            Stock("shenzi company",45,21)
    };
    cout<<"股份持有："<<endl;
    for (int i = 0; i < STKS; i++)
    {
        stocks[i].show();
    }
    const Stock* top=&stocks[0];
    for (int i = 1; i < STKS; i++)
    {
        top=&top->topval(stocks[i]);
    }
    cout<<"最多持股：\n";
    top->show();
    return 0;
}